// 0.5-1倍
function pb0Pto1(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 0.5 && pb <= 1) score += 10;
        else if (pb < 0.5 || (pb > 1 && pb <= 1.2)) score += 7;
        else if (pb > 1.2 && pb <= 1.5) score += 3;
        else if (pb > 1.5 && pb <= 2) score -= 5;
        else if (pb > 2) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 0.5-1.5倍
function pb0Pto1P(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 0.5 && pb <= 1.5) score += 10;
        else if (pb < 0.5 || (pb > 1.5 && pb <= 2)) score += 7;
        else if (pb > 2 && pb <= 2.5) score += 3;
        else if (pb > 2.5 && pb <= 3) score -= 5;
        else if (pb > 3) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 1-1.5倍
function pb1to1P(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 1 && pb <= 1.5) score += 10;
        else if ((pb >= 0.5 && pb < 1) || (pb > 1.5 && pb <= 1.8)) score += 7;
        else if (pb < 0.5 || (pb > 1.8 && pb <= 2)) score += 3;
        else if (pb > 2 && pb <= 2.5) score -= 5;
        else if (pb > 2.5) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 1-2倍
function pb1to2(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 1 && pb <= 2) score += 10;
        else if ((pb >= 0.5 && pb < 1) || (pb > 2 && pb <= 2.5)) score += 7;
        else if (pb < 0.5 || (pb > 2.5 && pb <= 3)) score += 3;
        else if (pb > 3 && pb <= 3.5) score -= 5;
        else if (pb > 3.5) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 1-2.5倍
function pb1to2P(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 1 && pb <= 2.5) score += 10;
        else if ((pb >= 0.5 && pb < 1) || (pb > 2.5 && pb <= 3)) score += 7;
        else if (pb < 0.5 || (pb > 3 && pb <= 3.5)) score += 3;
        else if (pb > 3.5 && pb <= 4) score -= 5;
        else if (pb > 4) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 1-3倍
function pb1to3(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 1 && pb <= 3) score += 10;
        else if ((pb >= 0.5 && pb < 1) || (pb > 3 && pb <= 3.5)) score += 7;
        else if (pb < 0.5 || (pb > 3.5 && pb <= 4)) score += 3;
        else if (pb > 4 && pb <= 4.5) score -= 5;
        else if (pb > 4.5) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 1.5-2.5倍
function pb1Pto2P(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 1.5 && pb <= 2.5) score += 10;
        else if ((pb >= 1 && pb < 1.5) || (pb > 2.5 && pb <= 3)) score += 7;
        else if ((pb >= 0.5 && pb < 1) || (pb > 3 && pb <= 3.5)) score += 3;
        else if (pb < 0.5 || (pb > 3.5 && pb <= 4)) score -= 5;
        else if (pb > 4) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 1.5-3倍
function pb1Pto3(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 1.5 && pb <= 3) score += 10;
        else if ((pb >= 1 && pb < 1.5) || (pb > 3 && pb <= 3.5)) score += 7;
        else if ((pb >= 0.5 && pb < 1) || (pb > 3.5 && pb <= 4)) score += 3;
        else if (pb < 0.5 || (pb > 4 && pb <= 4.5)) score -= 5;
        else if (pb > 4.5) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 1.5-3.5倍
function pb1Pto3P(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 1.5 && pb <= 3.5) score += 10;
        else if ((pb >= 1 && pb < 1.5) || (pb > 3.5 && pb <= 4)) score += 7;
        else if ((pb >= 0.5 && pb < 1) || (pb > 4 && pb <= 4.5)) score += 3;
        else if (pb < 0.5 || (pb > 4.5 && pb <= 5)) score -= 5;
        else if (pb > 5) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 2-3倍
function pb2to3(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 2 && pb <= 3) score += 10;
        else if ((pb >= 1 && pb < 2) || (pb > 3 && pb <= 3.5)) score += 7;
        else if (pb < 1 || (pb > 3.5 && pb <= 4)) score += 3;
        else if (pb > 4 && pb <= 5) score -= 5;
        else if (pb > 5) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 2-4倍
function pb2to4(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 2 && pb <= 4) score += 10;
        else if ((pb >= 1 && pb < 2) || (pb > 4 && pb <= 5)) score += 7;
        else if (pb < 1 || (pb > 5 && pb <= 6)) score += 3;
        else if (pb > 6 && pb <= 7) score -= 5;
        else if (pb > 7) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 2-5倍
function pb2to5(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 2 && pb <= 5) score += 10;
        else if ((pb >= 1 && pb < 2) || (pb > 5 && pb <= 6)) score += 7;
        else if (pb < 1 || (pb > 6 && pb <= 7)) score += 3;
        else if (pb > 7 && pb <= 8) score -= 5;
        else if (pb > 8) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 3-5倍
function pb3to5(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 3 && pb <= 5) score += 10;
        else if ((pb >= 2 && pb < 3) || (pb > 5 && pb <= 6)) score += 7;
        else if (pb < 2 || (pb > 6 && pb <= 7)) score += 3;
        else if (pb > 7 && pb <= 8) score -= 5;
        else if (pb > 8) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 3-6倍
function pb3to6(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 3 && pb <= 6) score += 10;
        else if ((pb >= 2 && pb < 3) || (pb > 6 && pb <= 7)) score += 7;
        else if (pb < 2 || (pb > 7 && pb <= 8)) score += 3;
        else if (pb > 8 && pb <= 10) score -= 5;
        else if (pb > 10) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 4-8倍
function pb4to8(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 4 && pb <= 8) score += 10;
        else if ((pb >= 2 && pb < 4) || (pb > 8 && pb <= 10)) score += 7;
        else if (pb < 2 || (pb > 10 && pb <= 10)) score += 3;
        else if (pb > 10 && pb <= 12) score -= 5;
        else if (pb > 12) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 4-10倍
function pb4to10(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 4 && pb <= 10) score += 10;
        else if ((pb >= 3 && pb < 4) || (pb > 10 && pb <= 11)) score += 7;
        else if ((pb >= 2 && pb < 3) || (pb > 11 && pb <= 12)) score += 3;
        else if (pb < 2 || (pb > 12 && pb <= 15)) score -= 5;
        else if (pb > 15) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 5-10倍
function pb5to10(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 5 && pb <= 10) score += 10;
        else if ((pb >= 2 && pb < 5) || (pb > 10 && pb <= 12)) score += 7;
        else if (pb < 2 || (pb > 12 && pb <= 13)) score += 3;
        else if (pb > 13 && pb <= 15) score -= 5;
        else if (pb > 15) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 6-12倍
function pb6to12(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 6 && pb <= 12) score += 10;
        else if ((pb >= 5 && pb < 6) || (pb > 12 && pb <= 13)) score += 7;
        else if ((pb >= 4 && pb < 5) || (pb > 13 && pb <= 14)) score += 3;
        else if (pb < 4 && pb > 14 && pb <= 15) score -= 5;
        else if (pb > 15) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 8-15倍
function pb8to15(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 8 && pb <= 15) score += 10;
        else if ((pb >= 6 && pb < 8) || (pb > 15 && pb <= 18)) score += 7;
        else if ((pb >= 4 && pb < 6) || (pb > 18 && pb <= 20)) score += 3;
        else if (pb < 4 && pb > 20 && pb <= 25) score -= 5;
        else if (pb > 25) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

// 10-20倍
function pb10to20(pb) {
    let score = 0
    if (pb > 0) {
        if (pb >= 10 && pb <= 20) score += 10;
        else if ((pb >= 7 && pb < 10) || (pb > 20 && pb <= 25)) score += 7;
        else if ((pb >= 5 && pb < 7) || (pb > 25 && pb <= 30)) score += 3;
        else if (pb < 5 && pb > 30 && pb <= 35) score -= 5;
        else if (pb > 35) score -= 10;
    } else {
        score -= 10;
    }
    return score
}

module.exports = {
    pb0Pto1,
    pb0Pto1P,
    pb1to1P,
    pb1to2,
    pb1to2P,
    pb1to3,
    pb1Pto2P,
    pb1Pto3,
    pb1Pto3P,
    pb2to3,
    pb2to4,
    pb2to5,
    pb3to5,
    pb3to6,
    pb4to8,
    pb4to10,
    pb5to10,
    pb6to12,
    pb8to15,
    pb10to20
};